#include <iostream>
#include <cstdio>
#include <algorithm>
#include <map>
#include <cstring>
#include <vector>
#include<queue>
using namespace std;
int f(int a, int b)
{
	int r;
	if (a < b)
	{
		r = a;
		a = b;
		b = r;
	}
	while (a % b)
	{
		r = a % b;
		a = b, b = r;
	}
	return b;
}
int main()
{
	int n,a[22],y;
	cin >> n;
	for (int i = 1; i <= n; i++)
	{
		cin >> a[i];
	}
	y = f(a[1], a[2]);
	for (int i = 3; i <= n; i++)
	{
		y = f(y, a[i]);
	}
	if (y < 0)
	{
		y = y + 2 * (-y);
	}
	cout << y << endl;
}